<script setup lang="ts">
import $data from "xcore/data";
import { useRoute } from 'vue-router';
import _ from "lodash";
const route = useRoute();
if ($data.store.conf.autoSave && $data.store.conf.saveSpan > 0) {
    setInterval(() => {
        let pageId = route.params.page_id as string
        if (!pageId) return
        let content = JSON.stringify($data.func.exportCmpnt($data.store.page))
        $data.provider.meta.setMetaPage({ name: pageId, content: content }).then(() => {
            console.log("save page:", pageId,$data.func.exportCmpnt($data.store.page));
        })
    }, 1000 * $data.store.conf.saveSpan)
}

</script>

<style></style>